import {Pipe, PipeTransform} from "@angular/core";
/**
 * Created by Administrator on 2017/3/28.
 */
@Pipe({name: 'timePeriodWeekType'})
export class TimePeriodWeekType implements PipeTransform {
    transform(value: any): string {
        let result: string = "-";
        for (let type of this.types) {
            if (type.value == value) {
                return type.name;
            }
        }
        return "未知"
    }


    types: any = [
        {name: "星期一", value: 1},
        {name: "星期二", value: 2},
        {name: "星期三", value: 3},
        {name: "星期四", value: 4},
        {name: "星期五", value: 5},
        {name: "星期六", value: 6},
        {name: "星期日", value: 7}
    ]


    getTypes(): any {
        return this.types
    }
}